Image processing apparatus and image processing method

ABSTRACT

An image processing apparatus includes: a dividing unit dividing at least one region on a digitalized image into multiple blocks; a scrambling unit producing an encrypted image by rearranging each block; a pixel value judging unit judging, for each block on the encrypted image, whether a difference between a statistically representative value of a pixel value of a first region included in the block and a statistically representative value of a pixel value of a second region is no smaller than a predetermined value, the second region being included in a block adjacent to the block and being adjacent to the first region; and a pixel value converting unit converting the pixel value of the first region in each block having the difference smaller than the predetermined value, while not converting the pixel value of the first region in each block having the difference no smaller than the predetermined value.

CROSS-REFERENCE TO RELATED APPLICATION

This application is a continuation application and is based uponPCT/JP2011/056615, filed on Mar. 18, 2011, the entire contents of whichare incorporated herein by reference.

FIELD

The embodiments discussed herein are related to an image processingapparatus and an image processing method for encrypting a digitalizedimage.

BACKGROUND

In recent years, a technology has been developed that prevents leakageof confidential information recorded on a medium such as paper.Particular examples of the technology that have been proposed are atechnique for embedding encoded information into an image, and atechnique for encrypting in advance a digitalized image that cannot beseen by the general public and then printing the encrypted image on amedium (for example, refer to Japanese Laid-open Patent Publication No.H07-254037 and Japanese Laid-open Patent Publication No. 2008-301044).For example, according to the technique disclosed in Japanese Laid-openPatent Publication No. H07-254037, a two-dimensional code is providedincluding position specifying symbols, a data region, timing cells, anda vertex detection cell that are arranged two-dimensionally according toa predetermined arrangement order.

In the technique disclosed in Japanese Laid-open Patent Publication No.2008-301044, an encryption apparatus rearranges on a block-by-blockbasis, pixels in an encryption target region of an inputted imageaccording to a predetermined encryption key. The encryption apparatusalso adds a position specifying marker for specifying the encryptedregion, to each of at least two of the four corners of the encryptedregion. Further, the encryption apparatus adds a check marker forchecking the validity of a decrypted image to be produced by decryptingthe encrypted region. A decryption apparatus of this techniquedigitalizes the image including the encrypted region by reading themedium on which the image is printed, by using a reader such as ascanner or a digital camera. The decryption apparatus then decrypts theencrypted region by referring to the position specifying markers in thedigitalized image, and thereby obtains the source image.

When an encrypted image produced by using such a technique forencrypting or encoding part of the information of the source image isprinted on a medium, it is preferable that the encrypted image bereadable by commonly-used readers such as scanners and camerasintegrated in mobile phones. In decrypting the encrypted image read by areader and then re-digitalized, it is preferable that the position ofeach block be detectable in the re-digitalized encrypted image. Toenable this, techniques for adding, to an encrypted image, informationfor specifying the position of each block have been proposed (forexample, refer to Published Japanese Translation of PCT InternationalPublication for Patent Application (Kohyo) No. H09-504660 and JapaneseLaid-open Patent Publication No. 2009-232129).

For example, the technique disclosed in Published Japanese Translationof PCT International Publication for Patent Application (Kohyo) No.H09-504660, proposes that reference marks are included in a documentthat are used for at least one operation including registration,scaling, rotation, shifting, and defect compensation in descrambling.

In addition, according to the technique disclosed in Japanese Laid-openPatent Publication No. 2009-232129, an image processing apparatusdivides an image into a plurality of small regions, rearranges the smallregions, and then converts the values of pixels constituting a part ofeach small region. This conversion facilitates detection of the positionof each small region.

In the above known techniques, the position of each block is madedetectable by inverting or shifting the values of the pixels inparticular blocks, or inverting or shifting the values of at least someof the pixels in each block. However, when an image is compressedaccording to an image compression standard, such as JPEG, or as for theoriginal values of the pixels in an encrypted image are converted byscanning a printed image, it may be difficult for the decryptionapparatus to decrypt an encrypted image to reproduce the original valuesof the pixels. As a result, the image quality of the decrypted imagereproduced by decrypting the encrypted image is degraded. Thus, an imageobtained through decryption is likely to have lower image quality whenblock-position specifying information is added to an encrypted image byconverting the values of pixels. For this reason, it is preferable toprevent position specifying information from being added if possible, orto add such information only to part of each block. When positionspecifying information is not added to an encrypted image, on the otherhand, it is difficult for the decryption apparatus to detect theaccurate position of each block, which also results in the problem thatthe image quality of the image produced by decryption is degraded.

SUMMARY

According to one embodiment, an image processing apparatus is provided.The image processing apparatus includes: a dividing unit which dividesat least one region on a digitalized image into a plurality of blocks; ascrambling unit which produces an encrypted image by rearranging theplurality of blocks according to a predetermined rule; a pixel valuejudging unit which judges, for each of the plurality of blocks on theencrypted image, whether or not a difference between a statisticallyrepresentative value of a pixel value of a first region and astatistically representative value of a pixel value of a second regionis no smaller than a predetermined value, the first region beingincluded in the block, the second region being included in a blockadjacent to the block and being adjacent to the first region; and apixel value converting unit which converts the pixel value of the firstregion included in each block whose difference between the statisticallyrepresentative value of the pixel value of the first region and thestatistically representative value of the pixel value of the secondregion is smaller than the predetermined value among the plurality ofblocks on the encrypted image, while not converting the pixel value ofthe first region included in each block having the difference no smallerthan the predetermined value among the plurality of blocks.

The object and advantages of the invention will be realized and attainedby means of the elements and combinations particularly pointed out inthe claims.

It is to be understood that both the foregoing general description andthe following detailed description are exemplary and explanatory and arenot restrictive of the invention, as claimed.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1 is a diagram illustrating in simplified form the configuration ofan image processing apparatus according to a first embodiment.

FIG. 2 is a block diagram illustrating the functions that a processingunit according to the first embodiment implements in order to encrypt asource image.

FIG. 3 is a diagram illustrating one example of blocks defined in anencryption region.

FIG. 4A is a diagram illustrating one example of respective blockpositions in the encryption region before scrambling.

FIG. 4B is a diagram illustrating one example of respective blockpositions in the encryption region after scrambling.

FIG. 4C is a diagram illustrating one example of a source image beforescrambling.

FIG. 4D is a diagram illustrating an encrypted image produced byperforming scrambling on the source image depicted in FIG. 4C accordingto the block rearrangement rule illustrated in FIG. 4A and FIG. 4B.

FIG. 5 is a diagram illustrating one example of the arrangement of aminimal region and adjacent regions.

FIG. 6 is an operation flowchart illustrating a pixel value judgingprocess.

FIG. 7A is a diagram illustrating one example of an encrypted imageproduced by scrambling and minimal regions defined in respective blocks.

FIG. 7B is a diagram illustrating one example of a result of judgmentabout pixel value conversion for each minimal region in the encryptedimage depicted in FIG. 7A.

FIG. 8 is an operation flowchart illustrating an image encryptionprocess under the control of a computer program executed on theprocessing unit of the image processing apparatus.

FIG. 9 is a block diagram illustrating the functions of a processingunit of an image processing apparatus according to a second embodiment.

FIG. 10 is a diagram illustrating one example of the arrangement of aminimal region and adjacent regions according to the second embodiment.

FIG. 11 is a block diagram illustrating the functions that a processingunit of a decryption apparatus implements for a process of decrypting anencrypted image.

FIG. 12A and FIG. 12B are each a diagram illustrating one example of anedge detection filter.

FIG. 13 is a diagram illustrating one example of an interpolationfilter.

DESCRIPTION OF EMBODIMENTS

Image processing apparatus according to various embodiments will bedescribed below with reference to the drawings. According to the imageprocessing apparatus described herein, a digitalized source image to beencrypted is divided into a plurality of blocks, and the blocks arerearranged according to a predetermined rule, thereby encrypting thesource image. In the encryption process, the image processing apparatusconverts the values of some pixels in particular blocks. Specifically,the image processing apparatus performs pixel value conversion only foreach of the blocks having a boundary difficult to be detected due to asmall difference in pixel value between the block and an adjacent block,among the blocks rearranged by scrambling. In this way, the imageprocessing apparatus reduces the number of pixels to be subjected topixel value conversion. This enables a decryption apparatus to detectthe individual block positions while suppressing the degradation of theimage quality of a decrypted image due to pixel value conversion. It isto be noted that an image produced by encryption is simply referred toas an “encrypted image” in this specification.

FIG. 1 is a diagram illustrating in simplified form the configuration ofan image processing apparatus according to a first embodiment. The imageprocessing apparatus 1 includes an interface unit 11, a user interfaceunit 12, a storage unit 13, and a processing unit 14. The imageprocessing apparatus 1 encrypts a source image acquired via theinterface unit 11.

The interface unit 11 includes, for example, a communication interfacethat connects the image processing apparatus 1 to an image input devicesuch as a digital camera or a mobile phone with a built-in camera (notdepicted), and a control circuit for the communication interface. Thecommunication interface may be an interface conforming to acommunication standard such as the Universal Serial Bus (USB) or theSmall Computer System Interface (SCSI), for example. Alternatively, theinterface unit 11 may include a communication interface for connectingthe image processing apparatus 1 to a communication network conformingto a communication standard such as the Ethernet (registered trademark),and a control circuit for the communication interface. The interfaceunit 11 acquires a digitalized image from the image input device orother apparatus connected to the communication network, and passes theimage to the processing unit 14.

The image processing apparatus 1 may also be connected to an outputdevice, such as a printer, via the interface unit 11. In this case, theinterface unit 11 may, for example, receive from the processing unit 14an encrypted image including an encryption region that is defined in thesource image and is encrypted, and output the encrypted image to theoutput device. Alternatively, the interface unit 11 may transmit theencrypted image to another apparatus connected to the image processingapparatus 1 via the communication network.

The user interface unit 12 includes a keyboard or a pointing device suchas a mouse, for example. The user interface unit 12 may also include adisplay device, such as a liquid crystal display, for displaying animage. In this case, for example, when a region of the image displayedon the display device is selected by a mouse in accordance with a useroperation, the user interface unit 12 acquires information indicatingthe specified region of the image, e.g., the coordinates of the upperleft end and the lower right end of the specified region. Then, the userinterface unit 12 notifies the processing unit 14 of the informationindicating the specified region.

The storage unit 13 includes at least one device selected, for example,from among a semiconductor memory device, a magnetic disk device, and anoptical disk device. The storage unit 13 stores a computer program to beexecuted on the processing unit 14 and various kinds of information tobe used in order to encrypt an image. Further, the storage unit 13stores the source image to be subjected to encryption. The source imagemay be acquired via the interface unit 11 as described above.Alternatively, the source image may be created by an application programexecuted on the processing unit 14.

The processing unit 14 includes one or a plurality of processors andperipheral circuitry thereof. The processing unit 14 encrypts theencryption region specified on the digitalized image.

FIG. 2 is a block diagram illustrating the functions that the processingunit 14 implements for a process of encrypting an image. The processingunit 14 includes a region specifying unit 21, a dividing unit 22, ascrambling unit 23, a pixel value judging unit 24, and a pixel valueconverting unit 25. These units constituting the processing unit 14 arefunctional modules implemented by executing a computer program on aprocessor incorporated in the processing unit 14. These unitsconstituting the processing unit 14 may be incorporated in the imageprocessing apparatus 1 as circuits for implementing the functions of therespective units or an integrated circuit with these circuits integratedtherein.

The region specifying unit 21 sets an encryption region to be encrypted,in a source image. The region specifying unit 21, for example, receivesinformation indicating a certain region on the source image, from theuser interface unit 12, and thereby sets the certain region as anencryption region. When the certain region informed by the userinterface unit 12 includes a region outside the image, the regionspecifying unit 21 may cause the user interface unit 12 to display awarning message indicating that a region outside the image is selected.Alternatively, the storage unit 13 may store a predetermined template,and the region specifying unit 21 may specify the region of the imagecorresponding to the template as the encryption region. The regionspecifying unit 21 then notifies the dividing unit 22 of informationindicating the encryption region, e.g., the coordinates of the upperleft end and the lower right end of the encryption region. When theencryption region is the entire image, the region specifying unit 21 maybe omitted.

The dividing unit 22 divides the encryption region specified by theregion specifying unit 21, into a plurality of rectangular blocks, andthen assigns unique numbers to the respective blocks. The blocks areeach a region used as a unit when the scrambling unit 23 to be describedlater performs position rearrangement.

FIG. 3 depicts an example of blocks defined in an encryption region. Anencryption region 301 is divided into a total of 12 blocks, i.e., threeblocks vertically and four blocks horizontally, for example. The blocksare assigned with respective numbers 1 to 12 in a predetermined order,e.g., a raster scan order. Specifically, the block in the upper left endof the encryption region 301 is assigned with the number “1”, and theblock in the lower right end of the encryption region 301 is assignedwith the number “12”, for example. It is to be noted that, althoughdotted lines are presented in the encryption region 301 in FIG. 3 tomake the block boundaries visible, the dotted lines are used only toillustrate the relationship between the encryption region and the blocksand are not added to the encryption region in the actual process.

Then, the dividing unit 22 notifies the scrambling unit 23 of theinformation indicating the ranges of the respective blocks or theboundaries between each two of the blocks as well as the numbersassigned to the respective blocks.

The scrambling unit 23 performs scrambling to rearrange the blocksaccording to a predetermined rearrangement rule determined by using anencryption key. For this purpose, the scrambling unit 23 constructs fromthe encryption key a mapping table that provides a mapping of blockpositions before and after the transformation. For example, suppose thatthe block position number after the transformation is designated by x,and the block position number before the transformation by y. The blockmapping equation used for the scrambling is as the follows.y=(px)mod q  (1)In equation (1), p and q are primes that the encryption key expresses,and p≠q. For example, when determining p=7 and q=13 determined by usingthe encryption key, the relationship between x and y is as presented inTable 1.

TABLE 1 x 1 2 3 4 5 6 7 8 9 10 11 12 y 7 1 8 2 9 3 10 4 11 5 12 6In this case, as presented in Table 1, when x is 1, the correspondingvalue of y is 7. Therefore, the scrambling unit 23 performs scramblingso that the block whose block number y before the transformation is 7 ismoved to the position of the block whose block number x after thetransformation is 1.

FIG. 4A depicts block positions in an encryption region beforescrambling for the case of p=7 and q=13 in equation (1) when theencryption region is divided into three blocks vertically and fourblocks horizontally, and FIG. 4B depicts the block positions in theencryption region after the scrambling. Further, FIG. 4C depicts asource image before the scrambling is applied thereto, and FIG. 4D is adiagram illustrating an encrypted image produced by applying thescrambling to the source image depicted in FIG. 4C, in accordance withthe block rearrangement rule illustrated in FIG. 4A and FIG. 4B.

In FIG. 4A, the number contained in each block in an encryption region401 before scrambling indicates the number of that block. Similarly, inFIG. 4B, the number contained in each block in an encryption region 402after the scrambling indicates the number of that block. As a result ofthe scrambling based on the mapping of the blocks before and after thescrambling depicted in FIG. 4A and FIG. 4B, a source image 403 depictedin FIG. 4C is transformed to an encrypted image 404 depicted in FIG. 4D.

The scrambling unit 23 passes the encrypted image including theencryption region after the scrambling, to the pixel value judging unit24.

The pixel value judging unit 24 judges, for each of the blocks on theencrypted image, whether or not to convert the values of the pixels in aminimal region defined contiguous to the boundaries of the adjacentblocks, in order to make the block position detectable. In thisembodiment, the minimal region is a region located at one of the corners(for example, the upper left corner) of each block and consisting of onepixel vertically and one pixel horizontally, or two pixels verticallyand two pixels horizontally, for example. The pixel value judging unit24 judges whether or not to convert the pixel values in the minimalregion, on the basis of the difference between the statisticallyrepresentative value of the pixel values of the minimal region and thestatistically representative value of the pixel values of the adjacentregions. The adjacent regions are each a region that is adjacent to theminimal region having a block boundary therebetween.

FIG. 5 is a diagram illustrating one example of the arrangement of aminimal region and adjacent regions. In FIG. 5, a minimal region 501 isdefined at the upper left end corner of a target block 511. Accordingly,for the minimal region 501, two adjacent regions 502 and 503 aredefined. The adjacent region 502 is adjacent to the upper end of theminimal region 501, and is a part of a block 512 adjacent to the upperside of the target block 511. The adjacent region 503 is adjacent to theleft end of the minimal region 501, and a part of a block 513 isadjacent to the left side of the target block 511. In this example, theshape and size of the adjacent regions 502 and 503 are equal to those ofthe minimal region 501. However, the shape and size of the adjacentregions 502 and 503 may be different from those of the minimal region501. For example, the height of the adjacent region 502 may be half ortwice the height of the minimal region 501. Similarly, the width of theadjacent region 503 may be half or twice the width of the minimal region501.

FIG. 6 is an operation flowchart illustrating a pixel value judgingprocess carried out by the pixel value judging unit 24. The pixel valuejudging unit 24 carries out the pixel value judging process for eachblock.

First, the pixel value judging unit 24 calculates a statisticallyrepresentative value of the pixel values of the minimal region and astatistically representative value of the pixel values of an adjacentregion in each block of which is adjacent to the minimal region having ablock boundary therebetween (step S101).

The statistically representative value of the pixel values of eachtarget region may be the average value, the most-frequent value, theminimum value, or the maximum value of the pixel values of the region,for example. When the source image is a gray image, the pixel valuejudging unit 24 calculates the statistically representative value fromthe pixel values of the region. When the source image is a color imageand each pixel value is set for each of the red component, the greencomponent, and the blue component, the statistically representativevalue of the pixel values of the region may be calculated by using thevalue of one of the color components as each pixel value. Alternatively,the pixel value judging unit 24 may calculate the statisticallyrepresentative value by using, as each pixel value, one of the followingvalues, i.e., a luminance value Y, color differences C1 and C2, hue H,and saturation S, of each of the pixels in the minimal region and theadjacent regions, according to a corresponding one of the followingequations.Y=0.299R+0.587G+0.114BC ₁=0.710R−0.587G−0.114BC ₂=−0.299R−0.587G+0.886BH=tan⁻¹(C ₁ /C ₂)S=√{square root over (C ₁ ² +C ₂ ²)}  (2)In equations (2), R, G, and B respectively denote the red componentvalue, the green component value, and the blue component value of apixel, and are each expressed by a value in the range from 0 to 255, forexample. When each of the minimal region and the adjacent regions isconsisted only of one pixel, the statistically representative value ofthe pixel value of each of the minimal region and the adjacent regionsis the pixel value itself of the corresponding one of the minimal regionand the adjacent regions.

The pixel value judging unit 24 judges whether or not there is adifference between the statistically representative value of the pixelvalues of the minimal region and the statistically representative valuesof the pixel values of the adjacent regions (step S102). For example,when the statistically representative value of the pixel values of theminimal region and the statistically representative values of the pixelvalues of the adjacent regions satisfy the condition represented by thefollowing equation, the pixel value judging unit 24 judges that thestatistically representative values have a difference.|A−B|+|A−C|≧Th0  (3)In equation (3), A denotes the statistically representative value of thepixel values of the minimal region. Further, B denotes the statisticallyrepresentative value of the pixel values of the adjacent regionvertically adjacent to the minimal region, and C denotes thestatistically representative value of the pixel values of the adjacentregion horizontally adjacent to the minimal region. In addition, Th0denotes a threshold value. The threshold value Th0 may be a fixed valuethat is set in advance. When a pixel value is expressed by a value inthe range from 0 to 255, the threshold value Th0 is set at 32, forexample. Alternatively, the pixel value judging unit 24 may set thethreshold value Th0 dynamically, on the basis of the source image. Inthis case, for example, the pixel value judging unit 24 may set, as thethreshold value Th0, the value obtained by multiplying the differencebetween the maximum pixel value and the minimum pixel value of thesource image or the encryption region, by a predetermined factor smallerthan 1 (e.g., 0.25).

When there is a difference between the statistically representativevalue of the pixel values of the minimal region and the statisticallyrepresentative values of the pixel values of the adjacent regions (Yesin step S102), it is estimated that a decryption apparatus can detectthe boundary between the target block and each of the adjacent blockshaving the respective adjacent regions defined therein. As a result, thepixel value judging unit 24 sets a flag indicating that pixel valueconversion is not to be applied to the minimal region (step S103).

When the statistically representative value of the pixel values of theminimal region and the statistically representative values of the pixelvalues of the adjacent regions do not have a difference (No in stepS102), on the other hand, it may be difficult for the decryptionapparatus to detect the boundary between the target block and each ofthe adjacent blocks having the respective adjacent regions definedtherein. In this case, the pixel value judging unit 24 judges whether ornot the adjacent regions are luminous, in order to determine whichconversion is to be performed on the pixel values in the minimal region(step S104).

For example, suppose that a higher pixel value indicates a more luminouspixel (i.e., a whiter pixel). In this case, the pixel value judging unit24 judges that the adjacent regions are luminous, when the averagevalues of the pixel values of the adjacent regions satisfy the conditionrepresented by the following equation.B+C>Th1  (4)In equation (4), B denotes the average value of the pixel values of theadjacent region vertically adjacent to the minimal region, and C denotesthe average value of the pixel values of the adjacent regionhorizontally adjacent to the minimal region. In addition, Th1 denotes athreshold value. The threshold value Th1 may be a fixed value that isset in advance. When a pixel value is expressed by a value in the rangefrom 0 to 255, the threshold value Th1 is set at 160, for example.Alternatively, the pixel value judging unit 24 may set the thresholdvalue Th1 dynamically, on the basis of the source image. In this case,the pixel value judging unit 24 may set, as the threshold value Th1, avalue determined by applying, for example, the discriminant analysismethod (Otsu's method) to the entire source image or the encryptionregion. Alternatively, the pixel value judging unit 24 may set, as thethreshold value Th1, the average pixel value of the entire source imageor the encryption region. Furthermore, the pixel value judging unit 24may set, as the threshold value Th1, the statistically representativevalue, such as the average pixel value or the most-frequent pixel value,of the minimal region.

When the adjacent regions are luminous (Yes in step S104), the pixelvalue judging unit 24 sets a flag indicating that the pixel values ofthe minimal region are to be set so that the corresponding pixels wouldbecome darker (step S105). On the other hand, when the adjacent regionsare dark (No in step S104), the pixel value judging unit 24 sets a flagindicating that the pixel values of the minimal region are to be set sothat the corresponding pixels would increase brightness (step S106).After the one of steps S103, S105, and S106, the pixel value judgingunit 24 notifies the pixel value converting unit 25 of the flag set forthe minimal region and the position or the number of the correspondingblock, and then terminates the pixel value judging process.

The pixel value converting unit 25 converts the pixel values of theminimal region for which the flag indicating the pixel values are to beset so that the corresponding pixels would become darker or increasebrightness is notified by the pixel value judging unit 24. For example,when the pixel value is expressed by a value in the range from 0 to 255and a higher pixel value indicates a more bright pixel, the pixel valueconverting unit 25 sets each of the pixel values of the minimal regionfor which the flag indicating that the pixel values are to be set sothat the corresponding blocks would become darker is notified, at avalue lower than the above threshold value Th1, e.g., 0. By contrast,the pixel value converting unit 25 sets each of the pixel values of theminimal region for which the flag indicating that the pixel values areto be set so that the corresponding pixels would increase brightness isnotified, at a value higher than the above threshold value Th1, e.g.,255.

When the image to be encrypted is a color image, the pixel valueconverting unit 25 may set, at 0, each of the values of all the colorcomponents or one or two particular color components of the minimalregion for which the flag indicating that the pixel values are to be setso that the corresponding pixels would become darker is notified.Similarly, the pixel value converting unit 25 may set, at 255, each ofthe values of all the color components or one or two particular colorcomponents of the minimal region for which the flag indicating that thepixel values are to be set so that the corresponding pixels wouldincrease brightness is notified. When only the values of particularcolor components are converted, the particular color componentspreferably include color components used by the pixel value judging unit24 for the comparison between the statistically representative value ofthe pixel values of the minimal region and the statisticallyrepresentative values of the pixel values of the adjacent regions.

FIG. 7A is a diagram illustrating one example of an encrypted imageproduced by scrambling and minimal regions defined in respective blocks.FIG. 7B is a diagram illustrating one example of a result of conversionabout pixel value conversion for each minimal region in the encryptedimage depicted in FIG. 7A.

An encrypted image 700 depicted in FIG. 7A and FIG. 7B is divided intothree blocks vertically and three blocks horizontally. The boundaries ofthe blocks are represented by dotted lines. In the upper left end ofeach of the blocks, a minimal region is defined. The minimal regions areeach surrounded by solid lines. In this example, three blocks 702 to 704are darker than the other blocks. In this example, the differencebetween the pixel values of a minimal region 712 of the block 702 andthe pixel values of the block adjacent to the region 712 on the leftside thereof is large. Therefore, as depicted in FIG. 7B, the pixelvalues of the minimal region 712 are not converted. Similarly, thedifferences between the pixel values of a minimal region 713 of theblock 703 and the pixel values of the blocks adjacent to the region 713on the left side thereof and on the upper side thereof are large.Therefore, as depicted in FIG. 7B, the pixel values of the minimalregion 713 are not converted.

By contrast, since the block 703 adjacent to the minimal region 714 ofthe block 704 on the left side thereof is also dark as the minimalregion 714 is, it is difficult to detect the boundary between the block703 and the block 704. In addition, the block 703 is relatively dark.Accordingly, as depicted in FIG. 7B, the pixel values of the minimalregion 714 are converted so that the corresponding pixels would increasebrightness. Regarding the other blocks, e.g., the block in the middle,the difference in pixel value between the block and the blocks adjacentto the minimal region of the block is small, and the adjacent blocks arerelatively luminous. Therefore, as depicted in FIG. 7B, the pixel valuesof the minimal region of each of the other blocks are converted so thatthe corresponding pixels would become darker. As has been describedabove, according to this embodiment, the pixel value converting unit 25needs not to perform pixel value conversion on all the blocks.

The processing unit 14 stores, in the storage unit 13, the encryptedimage produced as described above. Alternatively, the processing unit 14may output the encrypted image to other apparatus via the interface unit11, or may print the encrypted image on a medium by using a device suchas a printer.

FIG. 8 is an operation flowchart illustrating an image encryptionprocess under the control of a computer program executed on theprocessing unit 14.

The region specifying unit 21 of the processing unit 14 defines anencryption region in a source image to be encrypted (step S201). Then,the region specifying unit 21 notifies the dividing unit 22 in theprocessing unit 14 of information indicating the encryption region. Thedividing unit 22 divides the encryption region into a plurality ofblocks, which each serve as a unit when scrambling is performed, andassigns unique numbers to the respective blocks (step S202). Then, thedividing unit 22 notifies the scrambling unit 23 in the processing unit14 of information indicating the ranges of the respective blocks or theboundaries between the blocks as well as the numbers assigned to therespective blocks. The scrambling unit 23 performs scrambling torearrange the blocks in the encryption region according to therearrangement rule determined by using the encryption key (step S203).Thereafter, the scrambling unit 23 passes the encrypted image producedby the scrambling, to the pixel value judging unit 24 in the processingunit 14.

The pixel value judging unit 24 carries out, for each of the blocks, theabove-described pixel value judging process on the encrypted image (stepS204). Then, the pixel value judging unit 24 notifies the pixel valueconverting unit 25 in the processing unit 14 of a flag indicatingwhether or not the pixel values of the minimal region set for each ofthe blocks are to be converted and whether or not the pixel values areto be converted so that the corresponding pixels would increasebrightness when pixel value conversion is to be performed. On the basisof the flag, the pixel value converting unit 25 converts only the pixelvalues of the minimal region defined in each of the blocks determined tobe subjected to pixel value conversion (step S205). Thereafter, theprocessing unit 14 terminates the image encryption process. In thisoperation, a plurality of encryption regions may be defined in oneimage. Such being the case, the processing unit 14 carries out theprocess in steps S202 to S205, for each of the encryption regions.

As has been described above, the image processing apparatus according tothe first embodiment checks the difference in pixel value between twosmall regions adjacent to each other having a block boundarytherebetween in an encryption region after scrambling. Then, only foreach target block whose difference is small, the image processingapparatus converts the pixel values of the small area in the block, anduses the pixels subjected to pixel value conversion as a block positiondetection marker. As just described, the image processing apparatus doesnot convert pixel values for each block whose position is detectablewithout being subjected to pixel value conversion. Further, as for eachblock to be subjected to pixel value conversion, only a small range isdefined as the region on which the image processing apparatus performspixel value conversion. Consequently, the image processing apparatusenables a decryption apparatus to detect each block position while beingcapable of suppressing the degradation of the image quality of adecrypted image produced by decrypting an encrypted image.

Next, an image processing apparatus according to a second embodimentwill be described. The image processing apparatus according to thesecond embodiment compares a minimal region of each block afterscrambling, with an adjacent region that is horizontally adjacent to theminimal region and an adjacent region that is vertically adjacent to theminimal region, individually, and judges whether or not to convert thepixel values of the minimal region, on the basis of the comparisonresults.

The image processing apparatus according to the second embodimentdiffers from the image processing apparatus according to the firstembodiment, in the process carried out by the pixel value judging unitof the processing unit. The following description therefore deals withthe process carried out by the pixel value judging unit and relatedunits. The details of the other components of the image processingapparatus can be found in the description of the correspondingcomponents in the first embodiment.

FIG. 9 is a block diagram illustrating the functions of a processingunit 14 of the image processing apparatus according to the secondembodiment. The processing unit 14 includes a region specifying unit 21,a dividing unit 22, a scrambling unit 23, a pixel value judging unit 24,and a pixel value converting unit 25. The pixel value judging unit 24includes a first pixel value judging unit 241 and a second pixel valuejudging unit 242.

The first pixel value judging unit 241 compares, for each block afterscrambling, the statistically representative value of the pixel valuesof a minimal region and the statistically representative value of thepixel values of a first adjacent region, which is horizontally adjacentto the minimal region having a block boundary therebetween.

FIG. 10 is a diagram illustrating an example of the arrangement of aminimal region and adjacent regions according to the second embodiment.In FIG. 10, a minimal region 1001 is defined at the upper left endcorner of a target block 1011. In this case, a first adjacent region1002 is adjacent to the minimal region 1001 at the left end thereof, andis included in a block 1012 adjacent to the target block 1011 on theleft side thereof. The minimal region 1001 may be divided into two equalsmaller regions 1022 and 1023 by a line 1021 that is equally distantfrom the left end and the upper end of the minimal region 1001, andthereby the first pixel value judging unit 241 may calculate thestatistically representative value of the pixel values in the smallregion 1022 adjacent to the adjacent region 1002. In such a case, thepixels located on the line 1021 may be considered to be included in boththe first smaller region and the second smaller region, or to beincluded in neither the first smaller region nor the second smallerregion.

The first pixel value judging unit 241 judges that the statisticallyrepresentative value of the pixel values of the minimal region differsfrom the statistically representative value of the pixel values of thefirst adjacent region when the statistically representative valuessatisfy the condition represented by the following equation.|A0−B|≧Th00  (5)In equation (5), A0 denotes the statistically representative value ofthe pixel values of the minimal region. The first pixel value judgingunit 241 may calculate the statistically representative value A0 inconsideration only of a partial region of the minimal region instead ofthe entire minimal region, the partial region being adjacent to thefirst adjacent region such as the smaller region 1022 depicted in FIG.10, for example. Further, B denotes the statistically representativevalue of the pixel values of the first adjacent region. In addition,Th00 denotes a threshold value. The threshold value Th00 is set at avalue similar to the threshold value Th0.

The second pixel value judging unit 242 compares, for each block afterscrambling, the statistically representative value of the pixel valuesof the minimal region and the statistically representative value of thepixel values of a second adjacent region, which is vertically adjacentto the minimal region having a block boundary therebetween.

Referring to FIG. 10 again, a second adjacent region 1003 is adjacent tothe minimal region 1001 at the upper end thereof, and is included in ablock 1013 adjacent to the target block 1011 on the upper side thereof.The second pixel value judging unit 242 may calculate the statisticallyrepresentative value of the pixel values in the smaller region 1023,which is adjacent to the adjacent region 1003, of the two equal smallerregions 1022 and 1023 defined by dividing the minimal region 1001 by theline 1021 that is equally distant from the left end and the upper end ofthe minimal region 1001.

The second pixel value judging unit 242 judges that the statisticallyrepresentative value of the pixel values of the minimal region differsfrom the statistically representative value of the pixel values of thesecond adjacent region when the statistically representative valuessatisfy the condition represented by equation (5). In this case, A0denotes the statistically representative value of the pixel values ofthe minimal region. The second pixel value judging unit 242, as thefirst pixel value judging unit 241, may calculate the statisticallyrepresentative value A0 in consideration only of a partial region of theminimal region instead of the entire minimal region, the partial regionbeing adjacent to the second adjacent region such as the smaller region1023 depicted in FIG. 10, for example. Further, B denotes thestatistically representative value of the pixel values of the secondadjacent region.

The pixel value judging unit 24 sets a flag indicating that pixel valueconversion is not to be performed on the minimal region, when at leastone of the first pixel value judging unit 241 and the second pixel valuejudging unit 242 judges that the statistically representative value ofthe pixel values of the minimal region differs from the statisticallyrepresentative value of the pixel values of the corresponding adjacentregion. By contrast, when both the first pixel value judging unit 241and the second pixel value judging unit 242 judge that the statisticallyrepresentative value of the pixel values of the minimal region does notdiffer from the statistically representative value of the pixel valuesof the corresponding adjacent region, the pixel value judging unit 24sets a flag indicating that pixel value conversion is to be performed onthe minimal region.

When setting, for the minimal region, the flag indicating that pixelvalue conversion is to be performed, the pixel value judging unit 24also judges whether or not to convert the pixel values of the minimalregion so that the corresponding pixels would increase brightness,according to the process in steps S104 to S106 in FIG. 6. In thejudgment, the pixel value judging unit 24 may judge whether or not thefirst and second adjacent regions are luminous, according to equation(4). Alternatively, the pixel value judging unit 24 may judge whether ornot to convert the pixel values of the minimal region so that thecorresponding pixels would increase brightness, on the basis of thepixel values included in the target adjacent region which is one of thefirst and second adjacent regions. For example, suppose that a higherpixel value indicates a more luminous pixel (i.e., a whiter pixel). Inthis case, the pixel value judging unit 24 judges that the targetadjacent region is luminous, when the statistically representative valueof the pixel values of the target adjacent region satisfies thecondition represented by the following equation.B>Th11  (6)In equation (6), B denotes the statistically representative value of thepixel values of the target adjacent region, and Th11 denotes a thresholdvalue. The threshold value Th11 is determined similarly to the thresholdvalue Th1 in the first embodiment, for example.

The pixel value judging unit 24 sets, for the minimal region, a flagindicating that the pixel values are to be converted so that thecorresponding pixels would become darker, when the target adjacentregion is luminous. By contrast, when the condition represented byequation (6) is not satisfied, i.e., the target adjacent region is dark,the pixel value judging unit 24 sets, for the minimal region, a flagindicating that the pixel values are to be converted so that thecorresponding pixels would increase brightness.

As has been described above, when there is a difference in pixel valuebetween the minimal region in each block after scrambling and at leastone of the adjacent region horizontally adjacent to the minimal regionand the adjacent region vertically adjacent to the minimal, the imageprocessing apparatus according to the second embodiment does not convertthe pixel values of the minimal region. In this way, the imageprocessing apparatus according to the second embodiment can furtherreduce the number of pixels to be subjected to pixel value conversion,and can thereby suppress the degradation of image quality of a decryptedimage.

According to a modified example, the pixel value converting unit mayjudge the pixel values of the minimal region determined to be subjectedto pixel value conversion, by performing a shift operation on thestatistically representative value of the pixel values of each adjacentregion that is adjacent to the minimal region. For example, when eachpixel value is expressed by a value in the range from 0 to 255, thepixel value converting unit may determine, as each pixel value of theminimal region, a value obtained by adding a value corresponding to halfthe maximum pixel value of the adjacent region, i.e., 127, to theaverage pixel value of the adjacent region. When the resultant valueexceeds 255, the pixel value converting unit determines, as each pixelvalue of the minimal region, a value obtained by subtracting 256 fromthe resultant value. In this case, the pixel value judging unit may omitsteps S104 to S106 in the pixel value judgment process illustrated inFIG. 6, and may instead set a flag indicating that pixel valueconversion is to be performed on the minimal region.

According to another modified example, the pixel value converting unitmay determine each pixel value after conversion for the minimal regionof each block determined to be subjected to pixel value conversion sothat the difference between each pixel value of the minimal region afterthe conversion and the statistically representative value of the pixelvalues of each adjacent region would be larger than the differencebetween each pixel value of the minimal region before the conversion andthe statistically representative value of the pixel values of theadjacent region. For example, the pixel value converting unit maydetermine each pixel value of the minimal region after conversion on thebasis of the statistically representative value of the pixel values ofthe minimal region. In this case, when the statistically representativevalue of the pixel values of the minimal region indicates that thepixels in the minimal region are more luminous than those of eachadjacent region, the pixel value converting unit determines, as eachpixel value of the minimal region after the conversion, a value obtainedby adding a predetermined positive offset value to the statisticallyrepresentative value of the pixel values of the minimal region. Bycontrast, when the statistically representative value of the pixelvalues of the minimal region indicates that the pixels in the minimalregion are darker than those of each adjacent region, the pixel valueconverting unit determines, as the pixel value of the minimal regionafter the conversion, a value obtained by subtracting the predeterminedoffset value from the statistically representative value of the pixelvalues of the minimal region. Further, the pixel value conversion unitmay set the predetermined offset value so that the smaller the absolutevalue of the difference between the statistically representative valueof the pixel values of the minimal region and the statisticallyrepresentative value of the pixel values of the adjacent region is, thelarger the predetermined offset value would be.

According to still another modified example, the processing unit mayadd, to an encrypted image, encryption region detection markersindicating the position and the range of each encryption region, afterthe specifying of the encryption region, scrambling, or the performingof pixel value conversion on the corresponding block by the pixel valueconverting unit. The processing unit adds the encryption regiondetection marker to a position close to each of the corners of theencryption region, for example. The encryption region detection markerseach have a shape and a size that are known to a decryption apparatus,and may be a pattern in which black regions and white regions eachhaving a predetermined width are alternately arranged, for example.

Next, description will be given of a decryption apparatus that decryptsan encrypted image created by the image processing apparatus accordingto each one of the above embodiments and the modified examples of theembodiments.

The decryption apparatus according to this embodiment, as the imageprocessing unit depicted in FIG. 1, includes an interface unit, a userinterface unit, a storage unit, and a processing unit. The decryptionapparatus acquires an encrypted image from other apparatus via theinterface unit. The other apparatus may be a device, e.g., a digitalcamera or a mobile phone with a built-in camera, that creates adigitalized encrypted image by capturing the encrypted image printed ona medium. Alternatively, the other apparatus may be a computer connectedto the decryption apparatus via a communication network. The processingunit of the decryption apparatus produces a decrypted image bydecrypting the encrypted image, and thereafter causes the user interfaceunit to display the decrypted image or outputs the decrypted image toother apparatus via the interface unit.

FIG. 11 is a block diagram illustrating the functions that theprocessing unit of the decryption apparatus implements for the processof decrypting an encrypted image. The processing unit 30 includes aregion detecting unit 31, a block position detecting unit 32, adescrambling unit 33, and a pixel value reconverting unit 34. Theseunits constituting the processing unit 30 are functional modulesimplemented by executing a computer program on a processor incorporatedin the processing unit 30. These units of the processing unit 30 may beincorporated in the decryption apparatus as circuits for implementingthe functions of the respective units or an integrated circuit withthese circuits integrated therein.

The region detecting unit 31 detects an encryption region. For example,when a user specifies a range in an encrypted image displayed on adisplay device of the user interface, by operating a pointing devicesuch as a mouse while looking at the encrypted image, the regiondetecting unit 31 acquires information indicating the specified rangefrom the device. Then, the region detecting unit 31 defines thespecified range as the encryption region. Alternatively, when encryptionregion detection markers are added to the encrypted image, the regiondetecting unit 31 may detect the encryption region detection markers byusing a general image recognition technique such as pattern matching orgraphics connectivity analysis. In this case, the region detecting unit31 specifies the encryption region on the basis of the positionalrelationship between the detected markers and the encryption region. Theregion detecting unit 31 notifies the block position detecting unit 32of information indicating the encryption region, e.g., the coordinatesof the upper left end and the lower right end of the encryption region.

The block position detecting unit 32 detects the position of each blockon the basis of the encryption region detected by the region detectingunit 31. For the detection, the block position detecting unit 32 detectsthe boundary between each two corresponding adjacent blocks or eachminimal region converted for pixel value by, for example, the imageprocessing apparatus.

The block position detecting unit 32 produces a blurred image byfiltering the encryption region with a median filter having a sizelarger than the minimal region, for example. The median filter is afilter that outputs, as the value of a pixel located in the middle ofthe median filter, the median value of the pixel values of a region towhich the filter is applied. In this example, when the minimal region isconsisted of only one pixel or two-by-two pixels, the median filter hasa size of three-by-three pixels or four-by-four pixels. In general, thedistribution of the pixel values of each block tends to fall within asmall range. As a result, when the pixel values of the minimal regionare converted, the pixel values are likely to be considerably differentfrom the average value or the median value of the pixel values of theblock in which the minimal region is included. For this reason, it ishighly possible that the pixel values of the minimal region convertedfor pixel value would be replaced with the values of pixels neighboringthe minimal region, when the median filter is applied to the encryptionregion.

Therefore, the block position detecting unit 32 produces a differenceimage by obtaining the absolute value of the value obtained bysubtracting the value of each of the pixels in the blurred image, fromthe value of the corresponding pixel in the original encryption region.In the difference image, the pixels converted for pixel value each havea relatively high pixel value, while pixels not converted for the pixelvalue each have a relatively low pixel value. As a result, each minimalregion including the pixels converted for pixel value appears in thedifference image.

Further, the block position detecting unit 32 produces an edge image byfiltering the blurred image with an edge detection filter. In general,since the pixel values of adjacent blocks are not correlated with eachother in an encrypted image, the pixel values may have a largedifference at the boundary between the adjacent blocks. Therefore, byapplying the edge detection filter to the difference image, an edgeimage having relatively high pixel values at the boundary between eachtwo adjacent blocks is obtained. Accordingly, the block positiondetecting unit 32 can easily detect each block position by analyzingsuch an edge image.

FIGS. 12A and 12B are each a diagram illustrating one example of theedge detection filter used by the block position detecting unit 32. Anedge detection filter 1201 depicted in FIG. 12A is a filter fordetecting vertical edges (i.e., edges having pixel values that vary inthe horizontal direction). An edge detection filter 1202 depicted inFIG. 12B is a filter for detecting horizontal edges (i.e., edges havingpixel values that vary in the vertical direction). In this embodiment,the block position detecting unit 32 produces a vertical edge imageincluding vertical edges detected by applying the vertical edgedetection filter to the blurred image, and also produces a horizontaledge image including horizontal edges detected by applying thehorizontal edge detection filter to the blurred image. As each of theedge detection filters, a second derivative filter such as a Laplacianfilter may be used, for example.

As has been described above, the pixels in each minimal region convertedfor pixel value have relatively high values in the difference image,while the pixels located at each block boundary where each two adjacentpixels have a large difference in pixel value have relatively highvalues in the edge image. By taking advantage of these features, theblock position detecting unit 32 produces a synthetic image by addingthe value of each pixel in the difference image and the value of thecorresponding pixel in the vertical edge image. Then, the block positiondetecting unit 32 obtains, for each horizontal row, the number of pixelseach of which has a pixel value no lower than a predetermined positivethreshold value, and thereby obtains a histogram of the numbers of thecorresponding pixels of the respective rows. In this case, the histogramincludes, in a certain cycle, a row having a larger number of pixelsthan neighboring rows. By using the histogram, the block positiondetecting unit 32 detects the rows each having a large number of pixels,as vertical block boundaries.

Similarly, the block position detecting unit 32 produces a syntheticimage by adding the value of each pixel in the difference image and thevalue of the corresponding pixel in the horizontal edge image. Then, theblock position detecting unit 32 obtains, for each vertical row, thenumber of pixels each of which has a pixel value no lower than thepredetermined positive threshold value, and thereby obtains a histogramof the numbers of the corresponding pixels of the respective rows. Byusing the histogram, the block position detecting unit 32 detects, ashorizontal block boundaries, the each row having a large number ofpixels and found in a certain cycle.

The block position detecting unit 32 notifies the descrambling unit 33of the coordinates of the horizontal and vertical boundaries of each ofthe blocks on the encrypted image.

The descrambling unit 33 performs descrambling on each encryptionregion. By using the encryption key and equation (1) for transformingeach block position that are used by the image processing apparatus toperform scrambling, the descrambling unit 33 determines an originalposition y of each block in the encryption region, the block having aposition x as the position of the position-transformed block after thescrambling. Then, the descrambling unit 33 transforms the position ofeach position-transformed block on the encrypted image back to theoriginal position of the position-transformed block, thereby generatinga decrypted image in which the position of each position-transformedblock is the same as that in the source image.

The pixel value reconverting unit 34 reconverts the pixel values of theminimal region of each block on the decrypted image produced bydescrambling the encrypted image. For this reconversion, the pixel valuereconverting unit 34 may use any one of various interpolation filtersfor interpolating the value of a target pixel to be interpolated byusing the values of neighboring pixels of the target pixel, for example.The pixel value reconverting unit 34 uses a filter for obtaining theweighted average of the values of the neighboring pixels by multiplyinga weighting factor to each of the values of the neighboring pixelsaccording to the following equation. The closer the neighboring pixel isto the target pixel, the larger the weighting factor becomes.

$\begin{matrix}{{Vp} = {\sum\limits_{i = 0}^{k - 1}{( {{Vn}_{i}/r_{i}} )/{\sum\limits_{i = 0}^{k - 1}( {1/r_{i}} )}}}} & (7)\end{matrix}$In equation (7), Vp denotes an estimated value of the original value ofa target pixel P in the minimal region, and Vn_(i) (i=0, 1, 2, . . . ,k−1) denotes the pixel value of a neighboring pixel n_(i) of the targetpixel in the decrypted image. In addition, r_(i) denotes a valuerepresenting the distance from the target pixel P to the neighboringpixel n_(i).

FIG. 13 is a diagram illustrating one example of the interpolationfilter when k=8 in equation (7). An interpolation filter 1300 is afilter for calculating an estimated value Vp of the target pixel P to beinterpolated, by using the values of eight neighboring pixels n₀ to n₇of the target pixel P. In this example, the distances from the targetpixel P to the respective neighboring pixels n₀ to n₇ are defined asfollows, for example.r0=r2=r4=r6=1r1=r3=r5=r7=2In this case, the estimated value Vp of the target pixel P is calculatedas follows.Vp=(2(Vn ₀ +Vn ₂ +Vn ₄ +Vn ₆)+(Vn ₁ +Vn ₃ +Vn ₅ +Vn ₇))/12

The pixel value reconverting unit 34 may also use the pixel value itselfof the target pixel P in the decrypted image before pixel valuereconversion, in order to obtain the estimated value of the originalvalue of the target pixel P. For example, the pixel value reconvertingunit 34 may use, as the estimated value of the target pixel, thearithmetic average value of the pixel values of a region having a sizeof three-by-three pixels and having the target pixel in the middle.

When the decryption apparatus decrypts an image obtained by digitalizingan encrypted image printed on a medium, the original information on eachminimal region subjected to pixel value conversion is not indicated inthe digitalized image. Accordingly, it is difficult for the decryptionapparatus to obtain the original value of each pixel in the minimalregion simply by inverting the value of the pixel of the minimal region.However, in the decrypted image obtained by decrypting the digitalizedimage by descrambling, the values of the pixels neighboring the minimalregion have relatively high correlation with the original values of thepixels in the minimal region. For this reason, the decryption apparatuscan estimate the original value of each pixel subjected to pixel valueconversion, by performing interpolation as described above. The pixelvalue reconverting unit 34 causes the display device of the userinterface unit to display the decrypted image produced by reconvertingthe pixel values of each minimal region of each block. Alternatively,the pixel value reconverting unit 34 may output the decrypted image toanother apparatus via the interface unit, or may store the decryptedimage in the storage unit.

In addition, the computer program for causing a computer to implementthe various functions of the processing unit in the image processingapparatus according to each one of the above embodiments and themodified examples of the embodiments may be provided in the form ofcomputer readable recording medium, such as a magnetic recording mediumor an optical recording medium.

All examples and conditional language recited herein are intended forpedagogical purposes to aid the reader in understanding the inventionand the concepts contributed by the inventor to furthering the art, andare to be construed as being without limitation to such specificallyrecited examples and conditions, nor does the organization of suchexamples in the specification relate to a showing of the superiority andinferiority of the invention. Although the embodiments of the presentinventions have been described in detail, it should be understood thatthe various changes, substitutions, and alternations could be madehereto without departing from the spirit and scope of the invention.

What is claimed is:
 1. An image processing apparatus comprising: ahardware processor configured to divide at least one region on adigitalized image into a plurality of blocks; produce an encrypted imageby rearranging the plurality of blocks according to a predeterminedrule; calculate, for each of the plurality of blocks on the encryptedimage, a statistically representative value of a pixel value of a pixelin a first region included in the block based on either a luminancevalue of the pixel included in the first region or at least one of aplurality of color components of the pixel; judge, for each of theplurality of blocks on the encrypted image, whether or not a differencebetween the statistically representative value of the pixel value of thefirst region and a statistically representative value of a pixel valueof a pixel in a second region is not smaller than a first predeterminedvalue, the second region being included in a block adjacent to the blockand being adjacent to the first region; and convert the pixel value ofthe first region included in each block having the difference smallerthan the first predetermined value among the plurality of blocks on theencrypted image, while not converting the pixel value of the firstregion included in each block having the difference which is not smallerthan the first predetermined value among the plurality of blocks.
 2. Theimage processing apparatus according to claim 1, wherein each of theplurality of blocks has a rectangular shape, and the first region isdefined at any one of four corners of the block including the firstregion, and the second region includes a first adjacent region which isadjacent to the first region in a first direction and a second adjacentregion which is adjacent to the first region in a second directionorthogonal to the first direction, and wherein the judging whether ornot the difference is not smaller than the first predetermined valueincludes: comparing, with the first predetermined value, a firstdifference between the statistically representative value of the pixelvalue of the first region and a statistically representative value of apixel value of the first adjacent region, and comparing, with the firstpredetermined value, a second difference between the statisticallyrepresentative value of the pixel value of the first region and astatistically representative value of a pixel value of the secondadjacent region, and the converting of the pixel value of the firstregion does not convert the pixel value of the first region in each ofthe plurality of blocks which has at least one of the first differenceand the second difference which is not smaller than the firstpredetermined value, while converting the pixel value of the firstregion in each of the plurality of blocks which has both the firstdifference and the second difference smaller than the firstpredetermined value.
 3. The image processing apparatus according toclaim 1, wherein, for each block whose difference between thestatistically representative value of the pixel value of the firstregion and the statistically representative value of the pixel value ofthe second region is smaller than the first predetermined value amongthe plurality of blocks on the encrypted image, the converting of thepixel value of the first region converts either a luminance value of thepixel included in the first region or at least one of a plurality ofcolor components of the pixel, to a value determined on the basis of thestatistically representative value of the pixel value of the secondregion.
 4. The image processing apparatus according to claim 3, wherein,for each block having the difference smaller than the firstpredetermined value among the plurality of blocks on the encryptedimage, the converting of the pixel value of the first region convertseither the luminance value of the pixel included in the first region orat least one of the plurality of color components of the pixel, to avalue lower than a second predetermined value when the statisticallyrepresentative value of the pixel value of the second region is notsmaller than the second predetermined value, while converting either theluminance value of the pixel included in the first region or at leastone of the plurality of color components of the pixel, to a value higherthan the second predetermined value when the statisticallyrepresentative value of the pixel value of the second region is lowerthan the second predetermined value.
 5. The image processing apparatusaccording to claim 1, wherein, for each block whose difference betweenthe statistically representative value of the pixel value of the firstregion and the statistically representative value of the pixel value ofthe second region is smaller than the first predetermined value amongthe plurality of blocks on the encrypted image, the converting of thepixel value of the first region converts either a luminance value of thepixel included in the first region or at least one of a plurality ofcolor components of the pixel, to a value so that a difference betweenthe value of the pixel after the conversion and the statisticallyrepresentative value of the pixel value of the second region is largerthan the difference between the statistically representative value ofthe pixel value of the first region and the statistically representativevalue of the pixel value of the second region.
 6. An image processingmethod comprising: dividing, by a processor, at least one region on adigitalized image into a plurality of blocks; producing, by theprocessor, an encrypted image by rearranging the plurality of blocksaccording to a predetermined rule; calculating, by the processor, foreach of the plurality of blocks on the encrypted image, a statisticallyrepresentative value of a pixel value of a pixel in a first regionincluded in the block based on either a luminance value of the pixelincluded in the first region or at least one of a plurality of colorcomponents of the pixel; judging, by the processor, for each of theplurality of blocks on the encrypted image, whether or not a differencebetween the statistically representative value of the pixel value of thefirst region and a statistically representative value of a pixel valueof a pixel in a second region is not smaller than a predetermined value,the second region being included in a block adjacent to the block andbeing adjacent to the first region; and converting, by the processor,the pixel value of the first region included in each block having thedifference smaller than the predetermined value among the plurality ofblocks on the encrypted image, while not converting the pixel value ofthe first region included in each block having the difference which isnot smaller than the predetermined value among the plurality of blocks.7. The image processing method according to claim 6, wherein each of theplurality of blocks has a rectangular shape, and the first region isdefined at any one of four corners of the block including the firstregion, and the second region includes a first adjacent region which isadjacent to the first region in a first direction and a second adjacentregion which is adjacent to the first region in a second directionorthogonal to the first direction, and wherein the judging whether ornot the difference between the statistically representative value forthe first region and the statistically representative value for thesecond region is not smaller than the predetermined value, compares,with the first predetermined value, a first difference between thestatistically representative value of the pixel value of the firstregion and a statistically representative value of a pixel value of thefirst adjacent region, and compares, with the first predetermined value,a second difference between the statistically representative value ofthe pixel value of the first region and a statistically representativevalue of a pixel value of the second adjacent region, and the convertingof the pixel value of the first region does not convert the pixel valueof the first region in each of the plurality of blocks which has atleast one of the first difference and the second difference which is notsmaller than the first predetermined value, while converting the pixelvalue of the first region in each of the plurality of blocks which hasboth the first difference and the second difference smaller than thefirst predetermined value.
 8. The image processing method according toclaim 6, wherein, for each block whose difference between thestatistically representative value of the pixel value of the firstregion and the statistically representative value of the pixel value ofthe second region is smaller than the first predetermined value amongthe plurality of blocks on the encrypted image, the converting of thepixel value of the first region converts either a luminance value of thepixel included in the first region or at least one of a plurality ofcolor components of the pixel, to a value determined on the basis of thestatistically representative value of the pixel value of the secondregion.
 9. The image processing method according to claim 8, wherein,for each block having the difference smaller than the firstpredetermined value among the plurality of blocks on the encryptedimage, the converting the pixel value of the first region convertseither the luminance value of the pixel included in the first region orat least one of the plurality of color components of the pixel, to avalue lower than a second predetermined value when the statisticallyrepresentative value of the pixel value of the second region is notsmaller than the second predetermined value, while converting either theluminance value of the pixel included in the first region or at leastone of the plurality of color components of the pixel, to a value higherthan the second predetermined value when the statisticallyrepresentative value of the pixel value of the second region is lowerthan the second predetermined value.
 10. The image processing methodaccording to claim 6, wherein, for each block whose difference betweenthe statistically representative value of the pixel value of the firstregion and the statistically representative value of the pixel value ofthe second region is smaller than the first predetermined value amongthe plurality of blocks on the encrypted image, the converting of thepixel value of the first region converts either a luminance value of thepixel included in the first region or at least one of a plurality ofcolor components of the pixel, to a value so that a difference betweenthe value of the pixel after the conversion and the statisticallyrepresentative value of the pixel value of the second region is largerthan the difference between the statistically representative value ofthe pixel value of the first region and the statistically representativevalue of the pixel value of the second region.
 11. A non-transitorycomputer readable recording medium having an image processing computerprogram recorded thereon for causing a computer to execute: dividing atleast one region on a digitalized image into a plurality of blocks;producing an encrypted image by rearranging the plurality of blocksaccording to a predetermined rule; calculating, for each of theplurality of blocks on the encrypted image, a statisticallyrepresentative value of a pixel value of a pixel in a first regionincluded in the block based on either a luminance value of the pixelincluded in the first region or at least one of a plurality of colorcomponents of the pixel; judging for each of the plurality of blocks onthe encrypted image, whether or not a difference between thestatistically representative value of the pixel value of the firstregion and a statistically representative value of a pixel value of apixel in a second region is not smaller than a predetermined value, thesecond region being included in a block adjacent to the block and beingadjacent to the first region; and converting the pixel value of thefirst region included in each block having the difference smaller thanthe predetermined value among the plurality of blocks on the encryptedimage, while not converting the pixel value of the first region includedin each block having the difference which is not smaller than thepredetermined value among the plurality of blocks.